1. Field of the Invention
The present invention generally relates to universal serial bus (USB), and more particularly to a transfer request block (TRB) cache system.
2. Description of Related Art
Universal Serial Bus (USB) is widely used in electronic devices for transferring data between a host and a peripheral device. The data transfer speed of USB 1.0 is 1.5 million bits per second (low speed) and 12 million bits per second (full speed). The data transfer speed of USB 2.0 is 480 million bits per second (high speed). USB 3.0 is released now and its data transfer speed is 4.8 billion bits per second (super speed). The detail description of USB 3.0 may be referred to “Universal Serial Bus 3.0 Specification.”
In a USB system, the data transfer between the host and the device is controlled by a host controller, and the communication between the host controller and the host is specified in a host controller interface (HCI), for example, “eXtensible Host Controller Interface for Universal Serial Bus (xHCI).”
In the USB system specified by xHCI, the data structure of the transfer request block (TRB) is utilized in the data transfer. FIG. 1 shows conventional TRBs that are transferred in sequence. Specifically, each TRB includes 4 double words (DW) or 16 bytes. The host reads 4 TRBs from the system memory when reading data. For example, the host will firstly read 4 TRBs (TRB1-TRB4) starting from TRB1, where TRB1 and TRB2 are configured to be the transferred data, and TRB3 and TRB4 are used for judgment. The host will read 4 TRBs (TRB3-TRB6) starting from TRB3 after TRB1 and TRB2 are processed. Accordingly, the last 2 TRBs (for example, TRB3-TRB4) read at a previous time and the first 2 TRBs (for example, TRB3-TRB4) read at a following time are doubly read.
Additionally, after the host reads the TRBs from the system memory, the host must wait if the device is not ready or cannot transfer data because of other factors. Once the device is ready, the host will read the TRBs from the system memory again so as to cause the TRBs to read again.
For the reason that the repeated reading occurs to cause time delay, time waste and power consumption when the conventional USB system reads the data, a need has arisen to propose a novel scheme for decreasing or avoiding the repeated reading and thus advancing the production efficiency and decreasing power consumption.